package collection;

import java.util.LinkedList;
import java.util.List;

/**
 * LinkedList集合功能：addFirst()头部添加、
 * addLast()尾部添加、removeFirst()头部删除、removeLast()尾部删除
 */
public class LinkedListDemo {
    public static void main(String[] args) {
        LinkedList<String> list = new LinkedList<String>();
        list.add("A");
        list.add("B");
        list.add("C");
        System.out.println(list.get(0));
        list.remove("C");
        list.addFirst("E");
        list.addLast("F");
        System.out.println(list);
        System.out.println(list.getFirst());
        System.out.println(list.getLast());
        list.removeFirst();
        list.removeLast();


    }
}
